package mybatis.web;

import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * Servlet implementation class CheckCodeInputServlet
 */
@WebServlet("/checkcode/*")
public class CheckCodeInputServlet extends BaseServlet {
	public void checkCode(HttpServletRequest request, HttpServletResponse response) throws IOException {
		HttpSession session = request.getSession();
		String checkCode =((String) session.getAttribute("checkCode")).toLowerCase();
		String code = request.getParameter("code").toLowerCase();
		System.out.println(checkCode);
		System.out.println("code="+code);
		if(code.equals(checkCode)) {
			responseJson(response,true);
		}else {
			responseJson(response,false);
		}
	}
}
